import CustomNavBar from '@/components/CustomNavBar/CustomNavBar.vue';

export default {
  components: {
    CustomNavBar
  },
  data() {
    return {
      isLoginMode: true, // 当前是否为登录模式
      formData: {
        email: '',
        password: '',
        username: ''
      },
    }
  },
  methods: {
    // 切换登录/注册模式
    toggleMode() {
      this.isLoginMode = !this.isLoginMode;
      this.formData = { email: '', password: '', username: '' };
    },
    
    // 提交表单
    handleSubmit() {
      if (this.isLoginMode) {
        console.log('执行登录操作', this.formData);
        // 实际调用登录API
      } else {
        console.log('执行注册操作', this.formData);
        // 实际调用注册API
      }
    }
  }
}